package cn.iocoder.yudao.module.erp.dal.mysql.finance.claim;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.erp.dal.dataobject.finance.claim.ClaimDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.erp.controller.admin.finance.claim.vo.*;

/**
 * 赔付明细 Mapper
 *
 * @author 天使管理员
 */
@Mapper
public interface ClaimMapper extends BaseMapperX<ClaimDO> {

    default PageResult<ClaimDO> selectPage(ClaimPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ClaimDO>()
                .eqIfPresent(ClaimDO::getShipper, reqVO.getShipper())
                .eqIfPresent(ClaimDO::getTotalAmount, reqVO.getTotalAmount())
                .betweenIfPresent(ClaimDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ClaimDO::getNote, reqVO.getNote())
                .eqIfPresent(ClaimDO::getClaimIdAmount, reqVO.getClaimIdAmount())
                .orderByDesc(ClaimDO::getId));
    }

}